Release 10.1A: OpenEdge Development:
Progress 4GL Reference
CURRENT-VALUE function
Returns the current integer value of a sequence defined in the Data Dictionary.
Syntax
sequenceAn identifier that specifies the name of a sequence defined in the Data Dictionary.
logical-dbnameAn identifier that specifies the logical name of the database in which the sequence is defined. The database must be connected. You can omit this parameter if the sequence name is unambiguous. If a sequence with this name exists in more than one connected database, then you must specify
Examplelogical-dbname.The following example finds the current value of the next-cust-num sequence and then looks for orders with that customer number:
Notes
- The current value of a sequence can be one of the following:
- Sequence values are stored in the database in which they are defined, and persist between each invocation of the CURRENT-VALUE statement or NEXT-VALUE function.
- You cannot invoke the CURRENT-VALUE function from within a WHERE clause. Doing so generates a compiler error. To use a result from the CURRENT-VALUE function in a WHERE clause, assign the result to a variable, then use the variable in the WHERE clause.
- You can use any combination of the NEXT-VALUE function, CURRENT-VALUE function, CURRENT-VALUE statement, and their dynamic versions. Use the dynamic version when you don’t know what the database name or sequence name is at runtime.
See also
CURRENT-VALUE statement, DYNAMIC-CURRENT-VALUE function, DYNAMIC-CURRENT-VALUE statement, DYNAMIC-NEXT-VALUE function, NEXT-VALUE function
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |